<?php
namespace app\librarys\qcloud_cos;

class Conf
{
    const PKG_VERSION = '1.0.0';

    const API_IMAGE_END_POINT = 'http://web.image.myqcloud.com/photos/v1/';
    const API_VIDEO_END_POINT = 'http://web.video.myqcloud.com/videos/v1/';
    const API_COSAPI_END_POINT = 'http://web.file.myqcloud.com/files/v1/';
    //请到http://console.qcloud.com/cos去获取你的appid、sid、skey
//    const APPID = '10018656';
//    const SECRET_ID = 'AKIDZ0wX3fcPN7bGX3uCma098dDUHeZsolEM';
//    const SECRET_KEY = 'xsOMDP9MVOlelPbJYJXMbS28Xbwu4iSG';
    public static function APPID()
    {
        return \Yii::$app->params['qcloud.cos.AppId'];
    }

    public static function SECRET_ID()
    {
        return \Yii::$app->params['qcloud.cos.SecretId'];
    }

    public static function SECRET_KEY()
    {
        return \Yii::$app->params['qcloud.cos.SecretKey'];
    }

    public static function BucketName()
    {
        return \Yii::$app->params['qcloud.cos.BucketName'];
    }

    /**
     * 文件在COS服务端的全路径，不包括/appid/bucketname
     * @param $fileName
     * @return mixed
     */
    public static function dstPath($fileName)
    {
        return \Yii::$app->params['qcloud.cos.Folder'] . $fileName;
    }


    public static function getUA()
    {
        return 'QcloudPHP/' . self::PKG_VERSION . ' (' . php_uname() . ')';
    }
}


//end of script
